import uvicorn
import sys
from pathlib import Path
from core.log import init_log
from core.app import init_app
from core.db import init_db
from os.path import realpath
from fastapi import FastAPI,APIRouter

sys.path.append(str(Path(__file__).absolute().parent))  # fix no module name

# 初始化log
project_root = realpath('./logs')
logger = init_log(project_root)

# 初始化数据库
db = init_db()

# 初始化路由
app = init_app()

if __name__ == "__main__":
    uvicorn.run("main:app", host="127.0.0.1", port=8000, reload=True)


